package cn.lijiguo.concurrency.part1.ch03;

/**
 * CreateThread3
 *
 * @author lijiguo
 * @date 2019/12/13 11:13
 */
public class CreateThread3 {

    private int i = 0;

    private byte[] bytes = new byte[1024];

    private static int counter = 0;

    public static void main(String[] args) {
        try {
            add(0);
        } catch (Error e) { // StackOverflowError
            e.printStackTrace();
            System.out.println(counter);
        }
    }

    private static void add(int i) {
        counter++;
       add(i+1);
    }
}
